﻿namespace RuoVea.WeighIns.Server.Models;

/// <summary>
/// 时段字典表
/// </summary>
[SugarTable(nameof(InsMeridiem), "时段字典表")]
public class InsMeridiem : EntityBase
{
    /// <summary>
    /// 时段代码
    /// </summary>
    [Required, MaxLength(20)]
    [SugarColumn(ColumnDescription = "时段代码", Length = 20, IsNullable = false)]
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 时段名称
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "时段名称", Length = 50, IsNullable = false)]
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序", IsNullable = true, DefaultValue = "10")]
    public int Sort { get; set; }

    /// <summary>
    /// 体重记录列表（导航属性）
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(InsWeighInfo.Meridiem))]
    public List<InsWeighInfo>? WeighRecords { get; set; }
}